import request from '../../utils/request';
import qs from "qs"
/**
 * 创建桥梁
 * @param {*} project 
 */
export function addBridge(params){
    return request('/design/bridge/add', {
        method: 'post',
        data: params
    });
}
export function queryRoadLimit(params) {//获取线路起始里程
    return request('/design/roadline/getMinAndMaxPk', {
        method: 'post',
        data: params
    });
}
/**
 * 删除桥梁
 * @param {*} project 
 */
export function deleteBridge(params){
    return request('/design/bridge/delete', {
        method: 'get',
        params,
        paramsSerializer: function (params) {
            return qs.stringify(params,{arrayFormat: 'repeat'})
        }
    });
}
/**
 * 桥梁编辑
 * @param {*} project 
 */
export function editBridge(params){
    return request('/design/bridge/update', {
        method: 'post',
        data: params
    });
}
/**
 * 查询项目下所有桥梁工程列表
 * @param {*} info 
 */
export function queryProjectBridges(params){
    return request('/design/bridge/list', {
        method: 'post',
        data: params
    });
}
/**
 * 查询桥梁下线路,布跨
 * @param {*} info 
 */
export function queryBridgeDetail(params){
    return request('/design/bridge/getBridgeById', {
        method: 'post',
        data: params
    });
}
/**
 * 桥梁计算
 * @param {*} info 
 */
export function caculateDefinitionInstanceProperty(params){
    return request('/design/componentInstance/caculateDefinitionInstanceProperty', {
        method: 'post',
        data: params
    });
}
/**
 * 创建桥梁主体
 * @param {*} project 
 */
export function addBridgeMain(params){
    return request('/design/bridgeMain/add', {
        method: 'post',
        data: params
    });
}
/**
 * 获取桥梁主体详情
 * @param {*} project 
 */
export function getMainBridge(params){
    return request('/design/bridgeMain/getBridgeMainById', {
        method: 'post',
        data: params
    });
}
/**
 * 获取桥梁主体列表
 * @param {*} project 
 */
export function getBridgeMainList(params){
    return request('/design/bridgeMain/list', {
        method: 'post',
        data: params
    });
}
/**
 * 获取桥梁树结构
 * @param {*} project 
 */
export function bridgeMainAndChild(params){
    return request('/design/bridgeMain/bridgeMainAndChild', {
        method: 'post',
        data: params
    });
}
/**
 * 计算构件高度
 * @param {*} project 
 */
export function calculatePierHeight(params){
    return request('/design/span/calculatePierHeight', {
        method: 'get',
        params,
        paramsSerializer: function (params) {
            return qs.stringify(params, { indices: false })
        }
    });
}

